package cn.edu.controller;

import cn.edu.domain.All;
import cn.edu.domain.InfoPageBean;
import cn.edu.domain.PieData;
import cn.edu.service.Col_InfomationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Davey chan
 */
@RestController
@RequestMapping("/Col_Infomation")
public class Col_InfomationController {
    @Autowired
    private Col_InfomationService infomationService;
    /*分页查询*/
    @PostMapping("/{currentPage}/{pageSize}/{academyName}")
    public Result infoselect(@PathVariable Integer currentPage,
                           @PathVariable Integer pageSize,
                           @PathVariable String academyName,
                           @RequestBody All t){
        InfoPageBean<All> pageBean = infomationService.infoselect(currentPage, pageSize,academyName,t);
        return new Result(Code.GET_OK,pageBean);
    }
    @RequestMapping("/getPie")
    public Result getPie(String academyName){
        List<PieData> pie = infomationService.getpie(academyName);
      return new Result(Code.GET_OK,pie);
    }
    @RequestMapping("/getBar")
    public Result getBar(String academyName){

        List<Integer> bar = infomationService.getBar(academyName);
      return new Result(Code.GET_OK,bar);
    }

    @RequestMapping("/getExamine")
    public Result getExamine(String academyName){
        List<Integer> bar = infomationService.getExamine(academyName);
        return new Result(Code.GET_OK,bar);
    }
    @RequestMapping("/getAward")
    public Result getAward(String academyName,String year){
        List<PieData> award = infomationService.getAward(academyName,year);
        return new Result(Code.GET_OK,award);
    }

}
